/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * HAPSIEResultados.java
 *
 * Created on 23/01/2012, 08:33:47 PM
 */
package Interfaz;

import javax.swing.JDialog;
import javax.swing.JOptionPane;

/**
 *
 * @author erika
 */
public class Resultados extends javax.swing.JDialog {

    /** Creates new form HAPSIEResultados */
    public Resultados(java.awt.Dialog parent) {
        super(parent);
        initComponents();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        boxPorArea = new javax.swing.JCheckBox();
        boxPorPPR = new javax.swing.JCheckBox();
        boxGeneral = new javax.swing.JCheckBox();
        botonReultados = new javax.swing.JButton();
        jButton2 = new javax.swing.JButton();
        jMenuBar1 = new javax.swing.JMenuBar();
        jMenu1 = new javax.swing.JMenu();
        jMenu2 = new javax.swing.JMenu();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(UsoHAPSIE.HAPSIEApp.class).getContext().getResourceMap(Resultados.class);
        setTitle(resourceMap.getString("resultados.title")); // NOI18N
        setName("resultados"); // NOI18N
        addWindowListener(new java.awt.event.WindowAdapter() {
            public void windowClosing(java.awt.event.WindowEvent evt) {
                formWindowClosing(evt);
            }
        });

        jLabel1.setText(resourceMap.getString("jLabel1.text")); // NOI18N
        jLabel1.setName("jLabel1"); // NOI18N

        jLabel2.setText(resourceMap.getString("jLabel2.text")); // NOI18N
        jLabel2.setName("jLabel2"); // NOI18N

        jLabel3.setText(resourceMap.getString("jLabel3.text")); // NOI18N
        jLabel3.setName("jLabel3"); // NOI18N

        boxPorArea.setText(resourceMap.getString("boxPorArea.text")); // NOI18N
        boxPorArea.setName("boxPorArea"); // NOI18N

        boxPorPPR.setText(resourceMap.getString("boxPorPPR.text")); // NOI18N
        boxPorPPR.setName("boxPorPPR"); // NOI18N

        boxGeneral.setText(resourceMap.getString("boxGeneral.text")); // NOI18N
        boxGeneral.setName("boxGeneral"); // NOI18N

        botonReultados.setText(resourceMap.getString("botonReultados.text")); // NOI18N
        botonReultados.setName("botonReultados"); // NOI18N
        botonReultados.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                botonReultadosActionPerformed(evt);
            }
        });

        jButton2.setText(resourceMap.getString("jButton2.text")); // NOI18N
        jButton2.setName("jButton2"); // NOI18N
        jButton2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton2ActionPerformed(evt);
            }
        });

        jMenuBar1.setName("jMenuBar1"); // NOI18N

        jMenu1.setText(resourceMap.getString("jMenu1.text")); // NOI18N
        jMenu1.setName("jMenu1"); // NOI18N
        jMenuBar1.add(jMenu1);

        jMenu2.setText(resourceMap.getString("jMenu2.text")); // NOI18N
        jMenu2.setName("jMenu2"); // NOI18N
        jMenuBar1.add(jMenu2);

        setJMenuBar(jMenuBar1);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(42, 42, 42)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(boxPorPPR)
                    .addComponent(boxGeneral)
                    .addComponent(boxPorArea)
                    .addComponent(jLabel1)
                    .addComponent(jLabel3)
                    .addComponent(jLabel2)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(botonReultados)
                        .addGap(85, 85, 85)
                        .addComponent(jButton2)))
                .addContainerGap(90, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(29, 29, 29)
                .addComponent(jLabel1)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jLabel2)
                .addGap(28, 28, 28)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel3)
                    .addComponent(boxPorArea))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(boxPorPPR)
                .addGap(14, 14, 14)
                .addComponent(boxGeneral)
                .addGap(35, 35, 35)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(botonReultados, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jButton2, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(42, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
 setVisible(false);
    getOwner().setVisible(true);
}//GEN-LAST:event_jButton2ActionPerformed

private void formWindowClosing(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowClosing
 setVisible(false);
    getOwner().setVisible(true);
}//GEN-LAST:event_formWindowClosing

private void botonReultadosActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_botonReultadosActionPerformed
   
    
   if (boxGeneral.isSelected() && boxPorArea.isSelected()&& boxPorPPR.isSelected()){
       JOptionPane.showMessageDialog(this, "Seleccione únicamente una opción");
   } 
   
   if( boxGeneral.isSelected() && boxPorArea.isSelected()){
       JOptionPane.showMessageDialog(this, "Seleccione únicamente una opción");
   }
   
   if( boxGeneral.isSelected() && boxPorPPR.isSelected()){
       JOptionPane.showMessageDialog(this, "Seleccione únicamente una opción");
   }
   if( boxGeneral.isSelected() && boxPorPPR.isSelected()){
       JOptionPane.showMessageDialog(this, "Seleccione únicamente una opción");
   }
    if(boxGeneral.isSelected()){
        this.setVisible(false);
        resultadosGeneral.setVisible(true);
    }   
    if(boxPorArea.isSelected()){
        this.setVisible(false);
        resultadosArea.setVisible(true);
        
    }
    
    
    if(boxPorPPR.isSelected()){
        this.setVisible(false);
        resultadosPPR.setVisible(true);
        
    }
    
     
}//GEN-LAST:event_botonReultadosActionPerformed

    /**
     * @param args the command line arguments
     */

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton botonReultados;
    private javax.swing.JCheckBox boxGeneral;
    private javax.swing.JCheckBox boxPorArea;
    private javax.swing.JCheckBox boxPorPPR;
    private javax.swing.JButton jButton2;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JMenu jMenu1;
    private javax.swing.JMenu jMenu2;
    private javax.swing.JMenuBar jMenuBar1;
    // End of variables declaration//GEN-END:variables
    private JDialog resultadosGeneral = new ResultadosGeneral(this);
    private JDialog resultadosArea = new ResultadosPorArea(this);
    private JDialog resultadosPPR = new ResultadosPorPPr(this);
}
